import request from '@/config/axios'

export const getFinanceList = async (params) => {
  return await request.get({
    url: '/financeDetail/getPage',
    params
  })
}

export const financeDeductCreate = async (data) => {
  return await request.post({
    url: '/financeDeduct/create',
    data
  })
}

export const financeTopUpCreate = async (data) => {
  return await request.post({
    url: 'financeTopUp/create',
    data
  })
}

export const getByUserId = async () => {
  return await request.get({
    url: '/financeAccount/getByUserId'
  })
}

export const financeTopUpList = async (params) => {
  return await request.get({
    url: '/financeTopUp/getPage',
    params
  })
}

export const financeDeductList = async (params) => {
  return await request.get({
    url: '/financeDeduct/getPage',
    params
  })
}

export const financeAccountList = async (params) => {
  return await request.get({
    url: '/financeAccount/getPage',
    params
  })
}

export const financeAccountDeduct = async (data) => {
  return await request.put({
    url: '/financeAccount/deduct',
    data
  })
}

export const financeAccountOnAndOff = async (data) => {
  return await request.put({
    url: '/financeAccount/onAndOff',
    data
  })
}

export const financeAccountExport = async (params) => {
  return await request.download({
    url: '/financeAccount/export-excel',
    params
  })
}

export const exportFinanceRecordExcel = async (params) => {
  return await request.download({
    url: '/financeTopUp/exportFinanceTopUpExcel',
    params
  })
}

export const exportFinanceDeductExcel = async (params) => {
  return await request.download({
    url: 'financeDeduct/exportFinanceDeductExcel',
    params
  })
}

export const exportFinanceDetailExcel = async (params) => {
  return await request.download({
    url: '/financeDetail/exportFinanceDetailExcel',
    params
  })
}
